<?php

include './functions.php';

$p = $_POST['p'];

$oldArr = file_get_contents("./data/db.txt");

$data = json_decode($oldArr,true);

$num = 2;
// 从数据库中截取部分数据 
$data = array_slice($data,($p-1)*$num,$num,true);

if($data){
	foreach ($data  as $k => $v) {
		$data[$k]['ctime'] = Ftime($v['ctime']);
	}
	exit(json_encode(['error'=>0,'data'=>$data]));
}else{
	exit(json_encode(['error'=>1,'data'=>'数据已经完了']));
}

